<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/private_chat_new.css?v={:config('other.ui_version')}" media="all">
    <style>
        .chat_right {
            width: 100%;
            margin-left: 0px;
        }

        .chat_session {
            height: 100%;
        }

        .chat_session .chat_user {
            width: 100%;
            margin-left: 0px;
        }
    </style>
</head>

<body>
    <!--发起单个私聊-->
    <div class="chat_right">
        <div class="layui-form" lay-filter="">
            <input type="hidden" name="ids" value="{$ids}">
            <input type="hidden" name="all" value="{$all}">
            <!--会话列表-->
            <div class="layui-form-item">
                <label class="layui-form-label">发送内容</label>
                <div class="layui-input-block">
                    <textarea name="content" placeholder="" rows="15" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="demo1">发送</button>
                </div>
            </div>
        </div>
    </div>

    <script src="/layuiadmin/layui/layui.2.6.8.js"></script>
    <script src="/static/jquery.min.js"></script>
    <script>
        layui.config({
            base: '/layuiadmin/' //静态资源所在路径
            , version: "{:config('other.ui_version')}"
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'admin'], function () {
            var $ = layui.$, form = layui.form, admin = layui.admin;
            form.on('submit(demo1)', function (obj) {
                //提交
                layer.load();
                admin.req({
                    url: '/admin/privatechat/mult_send_chat'
                    , data: obj.field
                    , success: function (res) {
                        layer.closeAll("loading");
                        console.log(res);
                        if (res.code == 0) {
                            // parent.layer.msg(res.msg, { icon: 1 });
                        }
                    }
                    , complete: function (res) {
                        // layer.closeAll("loading");
                    }
                });
                parent.layer.msg('发送中...', { icon: 1 });
                layer.closeAll("loading");

                return false;
            });
        });
    </script>
</body>

</html>